import request from '@/utils/request'

const channelApi = {
  ChannelPage: 'qw/gameTaskChannel/page',
  saveChannel: 'qw/gameTaskChannel/save',
  deleteChannel: 'qw/gameTaskChannel/remove',
  createQrCode: 'qw/gameTaskChannel/getChannelQrCode'
}

export function createQrCode (parameter) {
  return request({
    url: channelApi.createQrCode,
    method: 'get',
    params: parameter
  })
}

export function deleteChannel (parameter) {
  return request({
    url: channelApi.deleteChannel,
    method: 'get',
    hideError: true,
    params: parameter
  })
}

export function saveChannel (parameter) {
  return request({
    url: channelApi.saveChannel,
    method: 'POST',
    hideError: true,
    data: parameter
  })
}

export function ChannelPage (parameter) {
  return request({
    url: channelApi.ChannelPage,
    method: 'get',
    params: parameter
  })
}

export default {
  deleteChannel,
  saveChannel,
  ChannelPage,
  createQrCode

}
